// components/cate-food/CateFood.js
Component({
  options: {
    addGlobalClass: true,
    multipleSlots: true
  },
  externalClasses: [
    'custom-class',
    'thumb-class',
    'title-class',
    'desc-class',
    'price-class'
  ],
  /**
   * 组件的属性列表
   */
  properties: {
    recommended: Boolean,
    thumb: String,
    thumbMode: {
      type: String,
      value: 'aspectFit'
    },
    currency: {
      type: String,
      value: '¥',
    },
    price: {
      type: String,
    },
    title: String,
    desc: String,
    originPrice: String,
    volume: String,
    grade: String,
    extra: String
  },

  /**
   * 组件的初始数据
   */
  data: {

  },

  /**
   * 组件的方法列表
   */
  methods: {
    handleClick() {
      this.triggerEvent('click', this.data)
    },
    handleAddToCart () {
      this.triggerEvent('addtocart', this.data)
    }
  }
})
